bitkeeper revision 1.282 (3f093fcaCmzVi3ORQ1OWHhWEtzbamA)
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Mon, 7 Jul 2003 09:39:22 +0000 (09:39 +0000)
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Mon, 7 Jul 2003 09:39:22 +0000 (09:39 +0000)
Make sure we try the physical partition table if we can't find
any partitions with the hypervisor.

xenolinux-2.4.21-sparse/fs/partitions/xeno.c

index 2d8f3b9543131fa75b3620253dc8b4098f575981..2ddc71b4d1a42ee0adf76b27b7dca11ece3e237e 100644 (file)
@@ -18,6 +18,7 @@ int xeno_partition(struct gendisk *hd,
   physdisk_probebuf_t *buf;
   int i;
   int minor;
+  int count;
 
   buf = kmalloc(sizeof(*buf), GFP_KERNEL);
   if (!buf)
@@ -39,6 +40,8 @@ int xeno_partition(struct gendisk *hd,
     return 0;
   }
 
+  count = 0;
+
   for (i = 0; i < buf->n_aces; i++) {
     if ((buf->entries[i].device & 0x1f) == 0)
       continue;
@@ -50,13 +53,20 @@ int xeno_partition(struct gendisk *hd,
     /* This is a bit of a hack - the partition numbers are specified
        by the hypervisor, and if we want them to match up, this is
        what we need to do. */
+    count ++;
     minor = (buf->entries[i].device & 0x1f) + first_part_minor - 1;
     add_gd_partition(hd,
                     minor,
                     buf->entries[i].start_sect,
                     buf->entries[i].n_sectors);
-  }
+  }  
   kfree(buf);
+
+  /* If we didn't find any suitable Xeno partitions, try the other
+     types. */
+  if (!count)
+    return 0;
+
   printk("\n");
   return 1;
 }